package thirdPartyUtils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.junit.Test;

public class Lombok {
    @Test  //lombok的@Data生成的equals函数不涉及父类
    public void lombok(){
        B aaa = new B("Enum","ddd");
        aaa.resp = "kkk";
        B kkk = new B("Enum","ddd");
        if (aaa.equals(kkk)){
            System.out.println("true");
        }

        k("d"); //java.lang.NullPointerException: a is marked non-null but is null
    }

    private A k(@NonNull String a){
        return null;
    }

}

class A {
    public String resp;
}

@Data
@AllArgsConstructor
class B extends A {
    @NonNull
    public String name;
    public String name2;
}
